namespace Maple.Branch.Features
{
    using FeatureProviders;
    using Options;
    using Volo.Abp.Caching;
    using Volo.Abp.Domain;
    using Volo.Abp.Features;
    using Volo.Abp.Modularity;

    [DependsOn(typeof(AbpDddDomainModule),
        typeof(AbpFeaturesModule),
        typeof(AbpCachingModule),
        typeof(FeaturesCommonModule))]
    public class FeaturesDomainModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            Configure<FeatureOptions>(options =>
            {
                options.Providers.Add<DefaultValueFeatureProvider>();
                options.Providers.Add<EditionFeatureProvider>();

                //TODO: Should be moved to the Tenant Management module
                options.Providers.Add<TenantFeatureProvider>();
                options.ProviderPolicies[TenantFeatureValueProvider.ProviderName] = "AbpTenantManagement.Tenants.ManageFeatures";
            });
        }
    }
}
